home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 1.iso / desktop / digclk12.zip / DIGCLOCK.BAS < prev    next >
BASIC Source File  |  1994-09-27  |  2KB  |  53 lines

  1. Option Explicit
  2. Declare Function GetPrivateProfileString% Lib "Kernel" (ByVal lpAppName$, ByVal lpKeyName$, ByVal lpDefault$, ByVal lpReturnedString$, ByVal nSize%, ByVal lpFileName$)
  3. Declare Function WritePrivateProfileString% Lib "Kernel" (ByVal lpAppName$, ByVal lpKeyName$, ByVal lpString$, ByVal lpFileName$)
  4. Declare Function SetWindowPos Lib "user" (ByVal h%, ByVal hb%, ByVal X%, ByVal Y%, ByVal cx%, ByVal cy%, ByVal f%) As Integer
  5. ' The above Declare statement must appear on one line.
  6.  
  7.  
  8. Global Const SWP_NOMOVE = 2
  9. Global Const SWP_NOSIZE = 1
  10. Global Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  11. Global Const HWND_TOPMOST = -1
  12. Global Const HWND_NOTOPMOST = -2
  13.  
  14. Type POINTAPI         ' Used for GetCursor - gets mouse location
  15.    X As Integer       ' in screen coordinates.
  16.    Y As Integer
  17. End Type
  18.  
  19. Type ConvertPOINTAPI  ' Used by WM_SYSCOMMAND - converts mouse location.
  20.    xy As Long
  21. End Type
  22.  
  23. ' Enter the following Declare statement as one, single line:
  24. Declare Function Sendmessage Lib "User" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Any) As Long
  25.  
  26. Declare Sub GetCursorPos Lib "User" (lpPoint As POINTAPI)
  27.  
  28.  
  29. Global Const WM_LBUTTONUP = &H202
  30. Global Const WM_SYSCOMMAND = &H112
  31. Global Const MOUSE_MOVE = &HF012
  32.  
  33. Global OnTop As Integer
  34. Global ClockColor As Integer
  35. Global TimeFormat As Integer
  36.  
  37. Global SecondsOn As Integer
  38. Global ColonOn As Integer
  39. Global OldTime
  40.  
  41. Sub CenterForm (frmIN As Form)
  42. Dim iTop, iLeft As Integer
  43.  
  44. If frmIN.WindowState <> 0 Then Exit Sub
  45. iTop = (Screen.Height - frmIN.Height) \ 2
  46. iLeft = (Screen.Width - frmIN.Width) \ 2
  47.    
  48. If iTop And iLeft Then
  49.    frmIN.Move iLeft, iTop
  50. End If
  51. End Sub
  52.  
  53.